#!/usr/bin/env python3
import sys

def parse_config_file(config_path):
    with open(config_path, 'r') as file:
        lines = file.readlines()

    defines = []
    for line in lines:
        if line.startswith('CONFIG_') and line.strip().endswith('=y'):
            define_name = line.split('=')[0].strip()
            defines.append(f"-D{define_name}=1")
    
    return defines

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print(f"Usage: {sys.argv[0]} <config_path>")
        sys.exit(1)
    
    config_path = sys.argv[1]
    defines = parse_config_file(config_path)
    print("\n".join(defines))